class Solution(object):
    def getLucky(self, s, k):
        t = ''
        for c in s:
            t += str(ord(c) - ord('a') + 1)
        c = 0
        while c < k:
            c += 1
            ans = 0
            for ch in t:
                ans += int(ch)
            t = str(ans)
        return ans

